//
//  WCNPiccExbutionCell.m
//  WCN
//
//  Created by wsj2015 on 16/4/1.
//  Copyright © 2016年 ShanghaiCize Trade And Business Co., Ltd. All rights reserved.
//

#import "WCNPiccExbutionCell.h"
#import "WCImageView +setImage.h"
#import "NSString+Utilities.h"
#import "WCTSetTextTool.h"
@implementation WCNPiccExbutionCell

- (void)awakeFromNib {
    // Initialization code
    self.backgroundColor =kAppBg;
    self.selectionStyle = UITableViewCellSelectionStyleNone;

    self.headIcon.layer.masksToBounds = YES;
    self.headIcon.layer.cornerRadius = 22;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (void)setModel:(WCNPiccExbutionRecordModel *)model
{
    _model = model;
    [self.headIcon wsjSetImageWithUrl:model.avatarFileId withPlaceImageName:nil];
    [WCTSetTextTool setTextView:self.timeLabel text:[NSString timeToString:[model.updateTime longLongValue]] initText:@""];
     [WCTSetTextTool setTextView:self.exbutionTimeLabel text:model.extubationDate initText:@""];
     [WCTSetTextTool setTextView:self.resonLabel text:model.extubationReason initText:@""];
     [WCTSetTextTool setTextView:self.byPeople text:model.extubationName initText:@""];
    if ([model.commentCount integerValue] ==0) {
        [self.commentBtn setImage:[UIImage imageNamed:@"Case_Comment"] forState:UIControlStateNormal];
    }else{
        [self.commentBtn setImage:[UIImage imageNamed:@"comment_hasNew"] forState:UIControlStateNormal];
    }
}

- (IBAction)commentAction:(id)sender {
    if (self.clickBlock) {
        self.clickBlock([self.model.id integerValue]);
    }
}

@end
